<ui:fragment xmlns="http://www.w3.org/1999/xhtml"
             xmlns:ui="http://java.sun.com/jsf/facelets"
             xmlns:h="http://java.sun.com/jsf/html"
             xmlns:f="http://java.sun.com/jsf/core"
             xmlns:a4j="http://richfaces.org/a4j"
             xmlns:fn="http://java.sun.com/jsp/jstl/functions"
             xmlns:rich="http://richfaces.org/rich">

    <h:form styleClass="jsfcrud_list_form">
        <h:outputText escape="false" value="#{bundle.ListColecaoEmpty}" rendered="#{colecaoController.items.rowCount == 0}"/>
        <h:panelGroup rendered="#{colecaoController.items.rowCount > 0}">
            <rich:dataTable style="width: 300px" id="listColecao" value="#{colecaoController.items}" var="item"  rowClasses="jsfcrud_odd_row,jsfcrud_even_row">

                <rich:column>
                    <f:facet name="header">
                        <h:outputText value="#{bundle.ListColecaoTitle_descricao}"/>
                    </f:facet>
                    <h:outputText value="#{item.descricao}"/>
                </rich:column>
                <rich:column>
                    <f:facet name="header">
                        <h:outputText value="#{bundle.ListColecaoTitle_dataColecao}"/>
                    </f:facet>
                    <h:outputText value="#{item.dataColecao}">
                        <f:convertDateTime pattern="dd/MM/yyyy" />
                    </h:outputText>
                </rich:column>
                <rich:column>
                    <f:facet name="header">
                        <h:outputText value=" "/>
                    </f:facet>
                    <h:commandLink  action="#{colecaoController.prepareEdit}"  immediate="true">
                        <h:graphicImage value="#{bundle.ListColecaoEditLink}" />
                    </h:commandLink>
                </rich:column>
                <rich:column>
                    <f:facet name="header">
                        <h:outputText value=" "/>
                    </f:facet>
                    <h:commandLink action="#{colecaoController.destroy}" immediate="true">
                        <h:graphicImage value="#{bundle.ListColecaoDestroyLink}" />
                    </h:commandLink>
                </rich:column>
            </rich:dataTable>
            <rich:dataScroller for="listColecao" maxPages="20" renderIfSinglePage="false" />
        </h:panelGroup>
    </h:form>
</ui:fragment>

